5 - Principles of Programming Languages [ID:11058]
50 von 1059 angezeigt

So today we'll talk about some programming languages that do not really fit into a single

category.

Either they are two main specific languages or they have a very specific goal in mind.

So there are a number of languages that don't really fit into any bigger paradigm that we'll

talk about today and next week.

So a generic paradigm such as Ada, Pascal, C, works for everything, it's a general programming

language.

But a general programming language will not give you an error if you're programming a

physics problem and that physics problem is internally inconsistent.

A general programming language will not give you an error message if your physics is wrong

if you're programming some physics problem.

If you're programming a physics problem in a programming language that is physics aware,

you're using the wrong units for something, that is something that a physics programming

language could warn you about.

So there are a number of programming languages that are better suited for a different programming

task than just something general like C or Java.

So there are a number of those.

We'll start with a very large number of programming languages that are suited for a given task.

For example, constraint programming.

In constraint programming you have a number of relations.

For example, something should be twice as big as something else.

Something should always be smaller than something else.

Like some sort of constraints.

How do you write those constraints?

They look like normal assignments.

They are not assignments, they are constraints.

If you say A equals B, it's not an assignment, it's a constraint that A should always be

equal to B.

For example, let's say we want to solve the eight queens problem.

So you have a chess board and you want to place queens on a chess board so that no queen

kills another queen.

So you have a checkerboard, you specify its data type, you specify what is valid and what

is invalid, and the system should then find the correct placement of queens on the chess

board to fit your solution.

So you as a programmer do not have to say anything about how to do it.

You just say to the system, these are my, this is my domain, these are my constraints,

find it.

That's ideal.

Unfortunately you can't specify everything as a constraint problem.

So it's not a generic paradigm.

You cannot write an editor using constraint programming.

You need something general for that.

For example, a constraint problem, another constraint problem.

You have a constraint that, first constraint is that Celsius is in some relation to Fahrenheit.

If Fahrenheit is 68, then there's a constraint.

Then the system should think, think, think, and come up with a solution that if that,

then Celsius would be 20.

You as yourself do not have to somehow think of how to convert these things.

The system should do it.

It's ideal.

Zugänglich über

Offener Zugang

Dauer

01:18:00 Min

Aufnahmedatum

2013-06-19

Hochgeladen am

2019-05-09 14:29:03

Sprache

en-US

Einbetten
Wordpress FAU Plugin
iFrame
Teilen